Skip to content

Inscoper::AbstractSubDevice

AbstractSubDevice class implements custom sub-devices. More...

#include <AbstractSubDevice.h>

Public Functions

Name
AbstractSubDevice(const Inscoper::SubDeviceId & subDeviceId)
Constructor.
AbstractSubDevice(const Inscoper::SubDeviceId & subDeviceId, const std::string & recipeId)
Constructor with recipe ID.
virtual ~AbstractSubDevice()
Destructor.
virtual void setValue(const std::vector< unsigned char > & data) =0
Set the value of the sub-device.
virtual std::vector< unsigned char > getValue() =0
Get the current value of the sub-device.
virtual void checkValue() =0
Check if the sub-device value has been properly set.
virtual const Inscoper::SubDeviceId getSubDeviceId() const
Get the sub-device ID.
virtual const std::string & getRecipeId() const
Get the recipe ID.

Detailed Description

class Inscoper::AbstractSubDevice;

AbstractSubDevice class implements custom sub-devices.

Note: This class is non-copyable and non-movable.

This abstract class establishes the contract for sub-devices, forcing the implementation of core accessors (get/set) and validation logic (check).

Public Functions Documentation

function AbstractSubDevice

explicit AbstractSubDevice(
    const Inscoper::SubDeviceId & subDeviceId
)

Constructor.

Parameters:

  • subDeviceId : The unique identifier for the sub-device

Initializes a new instance of the AbstractSubDevice class with a specific sub-device ID.

function AbstractSubDevice

AbstractSubDevice(
    const Inscoper::SubDeviceId & subDeviceId,
    const std::string & recipeId
)

Constructor with recipe ID.

Parameters:

  • subDeviceId : The unique identifier for the sub-device
  • recipeId : The recipe identifier associated with this sub-device

Initializes a new instance of the AbstractSubDevice class with a specific sub-device ID and an associated recipe ID.

function ~AbstractSubDevice

virtual ~AbstractSubDevice()

Destructor.

function setValue

virtual void setValue(
    const std::vector< unsigned char > & data
) =0

Set the value of the sub-device.

Parameters:

  • data : The value to set, represented as a byte vector

Sets the operational value or state of the sub-device. Must be overridden.

function getValue

virtual std::vector< unsigned char > getValue() =0

Get the current value of the sub-device.

Return: The current value as a byte vector

Retrieves the current operational value or state of the sub-device. Must be overridden.

function checkValue

virtual void checkValue() =0

Check if the sub-device value has been properly set.

Verifies if last set is effective. Must be overridden.

function getSubDeviceId

virtual const Inscoper::SubDeviceId getSubDeviceId() const

Get the sub-device ID.

Return: The sub-device ID

Retrieves the unique identifier of this sub-device.

function getRecipeId

virtual const std::string & getRecipeId() const

Get the recipe ID.

Return: The recipe ID

Retrieves the recipe identifier associated with this sub-device.


Updated on 2026-04-02 at 10:55:35 +0200